<template>
	<view class="zone">
		<u-navbar :is-back="false"  :background="background" :border-bottom="false">
			<view class="slot-wrap">
				<view class="nav-bar">
					<u-icon class="back" size="20px"  @click="$p.back()" name="arrow-left"></u-icon>
					<text>记录</text>
				</view>
			</view>
		</u-navbar>

		<view class="main">
			<view class="marb" v-for="(item,index) in datalist" :key="index">
				<p class="qi">{{item.data}}</p>
				<view class="box">
					<view class="top">
						<view class="t_outside">
							<view>
								<p>本期自己投喂</p>
								<p><text>{{item.feed_nums}}斤</text></p>
							</view>
						</view>
						<p class="line"></p>
						<view class="t_outside">
							<view>
								<p>本人瓜分水晶</p>
								<p><text>{{item.user_reward}}个</text></p>
								
							</view>
						</view>
					</view>
					<view class="titbox">
						<text>神兽</text>
						<text>本期斤数</text>
						<text>瓜分水晶</text>
					</view>
					<view class="list" v-for="(v , i) in item.sort.id" :key="i">
						<view class="anleft">
							<image :src="'http://img.cpgm.cc/panda/static/feed/' + v + '.png'" mode="widthFix" />
							<view v-if="i == 0 || i == 4 ">
								{{i == 0?'最大':'最小'}}
							</view>
						</view>
						<p class="cenp"> <text>{{item.sort.num[i]}}</text> 斤</p>
						<view class="anright" v-if="i == 0 || i == 4">
							<p> <text>{{i==0?item.max_pool:item.min_pool}}</text> 个</p>
							<p>每斤瓜分水晶{{i==0?item.max_per:item.min_per}}个</p>
						</view>
						<view class="anright" v-else>
							<p> <text>0</text> 个</p>
						</view>
					</view>
					<view class="botbox">
						<!-- 神兽列表 -->
						<view class="anlist">
							<view class="a_item" v-for="(v2 , i2) in item.user_sort.id" :key="i2">
								<image :src="'http://img.cpgm.cc/panda/static/feed/' + v2 + '.png'" mode="widthFix" />
								<span>已喂{{item.user_sort.num[i2]}}斤</span>
								<view class="i_posa" v-if="i2 == 0 || i2 == 4 ">
									{{i2 == 0?'最大':'最小'}}
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>

			<view class="nonelog" v-if="datalist == ''">
				无记录，快去喂神兽分奖金吧
			</view>
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [
					{
						img: '5.png',
						jin: '',
						gold: 677,
						gua: 1.9
					},
					{
						img: '4.png',
						jin: '',
						gold: 677,
						gua: 1.9
					},
					{
						img: '3.png',
						jin: '',
						gold: 677,
						gua: 1.9
					}, {
						img: '2.png',
						jin: '',
						gold: 677,
						gua: 1.9
					}, {
						img: '1.png',
						jin: '',
						gold: 677,
						gua: 1.9
					}
				],
				datalist:'',
				imgvalue:[],
				background:{
					background:'#C7DDDA'
				}
			};
		},
		onLoad(){
			this.feedLogs()
		},
		methods: {

			ar(item){
				let key = Object.keys(item);
				// for (let i = 0; i < key.length; i++) {
				// 	this.imgvalue.push(item[key[i]])
				// }

				return key
				// this.imgvalue = []
				
			},

			

			async feedLogs(){
				let res = await this.$http.index.feedLogs()
				this.datalist = res.data
			},
		},
	}
</script>

<style lang="less">

.zone {
	min-height: 100vh;
	background: linear-gradient(180deg, #C7DDDA 0%, #C7DDDA 100%);
	background-size: 100% 100%;
}

	.main {
		padding: 12px;
	}


	.qi {
		color: #696969;
		font-size: 14px;
	}

	.box {
		margin-top: 10px;
		background: url('http://img.cpgm.cc/panda/static/feed/bg3.png');
		background-size: 100% 100%;
		padding: 10px;
	}	

	.top {
		display: flex;
		align-items: center;
		justify-content: space-between;

		.t_outside {
			width: 45%;
			display: flex;
			align-items: center;
			justify-content: center;

			image {
				width: 30px;
				margin-right: 5px;
			}
			view {
				display: flex;
				flex-direction: column;
				align-items: center;

			p:nth-child(1) {
				color: #696969;
				font-size: 12px;
			}

			p:nth-child(2) {
				color: #696969;
				font-size: 14px;

				text {
					font-weight: 600;
					color: #000000;
					font-size: 20px;
					margin-right: 2px;
				}
			}
		}
		}
	}

	.line {
		width: 1px;
		height: 30px;
		background: rgba(0, 0, 0, 0.2);
	}
	.titbox {
		padding: 10px;
		background: rgba(255, 255, 255, 0.6);
		border-radius: 5px;
		margin: 10px 0;
		display: flex;
		align-items: center;
		justify-content: space-between;

		text {
			width: 30%;
			text-align: center;
			color: #696969;
		}
	}

	.list {
		padding: 5px 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 5px 0;
	}

	.anleft {
		width: 30%;
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;

		image {
			width: 60px;
		}

		view {
			width: 35px;
			height: 15px;
			font-size: 12px;
			line-height: 15px;
			text-align: center;
			position: absolute;
			background: rgba(0, 0, 0, 0.5);
			border-radius: 7px;
			top: 5%;
			right: 0%;
			color: #fff;
		}
	}

.cenp {
		color: #000;
		font-size: 14px;

		text {
			font-size: 14px;
		}
	}


	.anright {
		width: 33%;
		display: flex;
		flex-direction: column;

		p:nth-child(1) {
			font-size: 12px;
			color: #000000;
			text-align: center;

			text {
				color: #000000;
				font-size: 14px;
				font-weight: 600;
			}
		}

		p:nth-child(2) {
			font-size: 12px;
			zoom: 0.9;
			color: #696969;
			text-align: center;
		}
	}

	.botbox {
		margin: 10px;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}



	// <!-- 神兽列表 -->

	.anlist {
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		position: relative;
	}

	.a_item {
		width: 20%;
		display: flex;
		align-items: center;
		flex-direction: column;
		position: relative;

		image {
			width: 90%;
		}

		span {
			color: #696969;
			font-size: 12px;
		}
	}

	.i_posa {
		position: absolute;
		top: 0%;
		right: 0;
		width: 60%;
		border-radius: 20px;
		font-size: 12px;
		line-height: 16px;
		background: rgba(0, 0, 0, 0.5);
		border-radius: 15px;
		color: #fff;
		text-align: center;
	}

	.boxleft {
		position: absolute;
		width: 42%;
		top: -15px;
		left: 15px;

		image {
			width: 100%;
		}

		view {
			display: flex;
			align-items: center;
			position: absolute;
			top: 50%;
			left: 10px;
			transform: translateY(-75%);

			image {
				width: 15px;
			}

			text {
				font-size: 12px;
			}
		}
	}

	.boxright {
		position: absolute;
		width: 42%;
		top: -15px;
		right: 15px;

		image {
			width: 100%;
		}

		view {
			display: flex;
			align-items: center;
			position: absolute;
			top: 50%;
			left: 10px;
			transform: translateY(-80%);

			image {
				width: 15px;
			}

			text {
				font-size: 12px;
			}
		}
	}

	.can {
		display: flex;
		align-items: center;
		justify-content: center;
		color: #696969;
	}

	.yb {
		width: 30px;
	}

.marb {
	margin-bottom: 12px;
	border-radius: 10px;
}

	.nonelog {
		color: rgba(255, 255, 255, .7);
		line-height: 50vh;
		font-size: 12px;
		text-align: center;
	}
	
</style>